package com.sb.hot.ext.convert;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import java.util.List;

@RestController
public class PeController {
    @Value("${com.userList}")
    List<User> user3;
    @Value("111111xaaaa")
    private User user;
    @Value("#{propertyValueDemo02.value}")
    private User user2;

    @PostConstruct
    public void init() {
        System.out.println("pe convert1:" + user); System.out.println("pe convert2:" + user2); System.out.println("pe convert3:" + user3);
    }

    @GetMapping("/peuser/{name}")
    public User hello(@PathVariable("name") User user) {
        return user;
    }
}
